<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="pg" uri="http://jsptags.com/tags/navigation/pager"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>合众人寿公益平台客户管理系统</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<SCRIPT type="text/javascript">
	      var GB_ROOT_DIR = "<%=request.getContextPath()%>/html/skin/";
        </SCRIPT>	
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<link href="<%= request.getContextPath() %>/html/css/Main.css"
			rel="stylesheet" type="text/css" />
		<link href="<%=request.getContextPath()%>/html/css/gb_styles.css"
			rel="stylesheet" type="text/css"/>
			<script type="text/javascript"
			src="<%=request.getContextPath()%>/html/js/AJS.js"></script>
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/html/js/AJS_fx.js"></script>
		<script type="text/javascript"
			src="<%=request.getContextPath()%>/html/js/gb_scripts.js"></script>
		<script src="<%=request.getContextPath()%>/html/js/Calendar.js"
			charset="utf-8"></script>
		 <link href="<%=request.getContextPath()%>/html/js/My97DatePicker/skin/WdatePicker.css"
			rel="stylesheet" type="text/css" />
		<script src="<%=request.getContextPath()%>/html/js/My97DatePicker/WdatePicker.js"
			charset="utf-8"></script>
			<style>
body,ul,ol,dl,dd,p,h1,h2,h3,h4,h5,h6,form,input,textarea,select,td,th{margin:0;padding:0; font-family:"宋体",Arial, Helvetica, sans-serif;}
li{ list-style:none;}
input{ background:none;}
.clear{ zoom:1;}
.clear:after{content:""; display:block; clear:both;}
</style>
	</head>

	<body>
	   <input type="hidden" value="${success}" id="success"/>
		<div class="container">
			<div class="wrap clear">
				<div class="sub_wp_right">
					<div class="rt_tt">
						<h3 class="tittle">
							文档列表
						</h3>
					</div>
					<div class="ct">
							<form action="<%=request.getContextPath()%>/document/searchDocuments.do"
								method="post" name="listForm" >
						<h3 class="sm_tt">
							查询条件
						</h3>

						<div class="tiaojian">
								<ul class="clear">
								     <li>
										<span>文档标题：</span>
										<input type="text" name="document.title" value="${document.title}"/>
									 </li>
									 <li>
										<span>上传日期：</span>
										<input type="text" name="startDate" id="startDate" value="${startDate}" onfocus="WdatePicker({startDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd'})" readonly="readonly"/>
									</li>
									<li>
										<span>至：</span>
										<input type="text" name="endDate" id="endDate" value="${endDate}" onfocus="WdatePicker({endDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd'})" readonly="readonly"/>
								    </li>
								 </ul>
								<div class="btn">
									<input type="submit" value="查询" />
								</div>
						</div>
						<div class="btn2">
							<input type="button" value="上传文档"
								onclick="location=('<%=request.getContextPath()%>/jsp/document/impDocument.jsp?error=0')">
						</div>
							<s:property
								value="@com.ulic.customerManApplication.pager.PagerTag@getStart('文档列表', #request.pm)"
								escape="false" />
						<div class="jieguo">
							<table border="0" cellpadding="0" cellspacing="0"
								class="listArea" width="100%">
								<thead>
									<tr>
										<th>
											文档标题
										</th>
										<th>
											文档描述
										</th>
										<th>
											上传人
										</th>
										<th>
											上传时间
										</th>
										<th>
											操作
										</th>
									</tr>
								</thead>
								<tbody id="bg">
									<s:if test="#request.pm.datas.size()==0">
										<tr>
											<td colspan="14" align="center">
												<font color="red">暂无数据！</font>
											</td>
										</tr>
									</s:if>
									<s:else>
										<s:iterator value="#request.pm.datas" var="document"
											status="status">
											<s:if test="#status.odd == true">
													<tr class="rowNormal"
														onmouseover="this.className='rowChecked'"
														onmouseout="this.className='rowNormal'">
												</s:if>
												<s:else>
													<tr class="rowAlternate"
														onmouseover="this.className='rowChecked'"
														onmouseout="this.className='rowAlternate'">
												</s:else>
												<td  align="center">
													<s:property value="#document.title" />
												</td>
												<td  align="center">
													<s:property value="#document.fileDesc" />
												</td>
												<td  align="center">
													<s:property value="#document.uploadPerson.user_Name" />
												</td>
												<td  align="center">
													<s:property value="#document.uploadDate" />
												</td>
												<td  align="center">
													<a
														href="<%=request.getContextPath()%>/document/expDocument.do?document.id=<s:property value="#document.id"/>">下载</a>
													 <a
															href="javascript:deleteDocument(<s:property value="#document.id"/>);">删除</a>
												</td>
											</tr>
										</s:iterator>
										<tr class="rowAlternate"
												onmouseover="this.className='rowChecked'"
												onmouseout="this.className='rowAlternate'">
											 <td colspan="5"  align="center">
											  	共上传  <s:property value="#request.pm.total" /> 个文档
											 </td>
											</tr>
									</s:else>
								</tbody>
							</table>
						</div>
							<s:property
								value="@com.ulic.customerManApplication.pager.PagerTag@getEnd(#request.pm)"
								escape="false" />
							</form>
						</div>
					</div>
				</div>
			</div>
	</body>
	<script type="text/javascript">
    function deleteDocument(id){
  		if(confirm("是否确认删除？")){
  			window.location.href="<%=request.getContextPath()%>/document/deleteDocument.do?document.id="+id;
  		}
  	}
  	var impDataInfor = document.getElementById("success").value;
  	if(impDataInfor =='1'){
  		 GB_showCenter("上传文档","<%=request.getContextPath()%>/jsp/document/impDataInfor.jsp?success=${success}",300,300);
  		document.getElementById("success").value = '';
  	}
  </script>
</html>
